﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Mvc.Ajax;

using ERPStore.Web.Routing;

namespace ERPStore.Web.Html
{
	public static class CheckoutExtensions
	{
		public static MvcHtmlString CheckoutLink(this HtmlHelper helper)
		{
			return CheckoutLink(helper, "Valider ma commande");
		}

		public static MvcHtmlString CheckoutLink(this HtmlHelper helper, string title)
		{
			return new MvcHtmlString(helper.RouteERPStoreLink(title, ERPStoreRoutes.CHECKOUT, new { action = "Shipping" }));
		}

		public static string CheckoutHref(this UrlHelper helper)
		{
			return helper.RouteERPStoreUrl(ERPStoreRoutes.CHECKOUT);
		}

		public static string CheckoutConfigurationHref(this UrlHelper helper)
		{
			return helper.RouteERPStoreUrl(ERPStoreRoutes.CHECKOUT_CONFIGURATION);
		}

		public static string CheckoutPaymentHref(this UrlHelper helper)
		{
			return helper.RouteERPStoreUrl(ERPStoreRoutes.CHECKOUT_PAYMENT);
		}

		public static MvcForm BeginWireTransferForm(this HtmlHelper helper, object htmlAttributes = null)
		{
			return helper.BeginERPStoreRouteForm("WiretransferPaymentConfirmation", FormMethod.Post, htmlAttributes);
		}

		public static MvcForm BeginDeferredPaymentForm(this HtmlHelper helper, object htmlAttributes = null)
		{
			return helper.BeginERPStoreRouteForm("DeferredPaymentConfirmation", FormMethod.Post, htmlAttributes);
		}

		public static MvcForm BeginCheckPaymentForm(this HtmlHelper helper, object htmlAttributes = null)
		{
			return helper.BeginERPStoreRouteForm("CheckPaymentConfirmation", FormMethod.Post, htmlAttributes);
		}
	}
}
